GUIDE FOR SETTING UP AI ON CUSTOM TRACKS

RECORDING

Use recording menu, or press F10 to start recording any vehicle (car, boat, bike, etc). Drive anywhere you want. To stop recording press F10 again. Set filename by pressing multiply (*) key. Then press HOME to export file to RRR. You can change REC_DENSITY to suit your needs. More density will record points more often, so files will be bigger. 

LOADING

You can load files to up to 50 slots, by using ingame menu. So, lets load our first RRR file. Press (*) numpad multiply key on your keyboard, and type in a  number of file. 

Alternative way is to open console and write file 1, or any other number. Each recording uses unique ID (eg. to search for carrec001.rrr, type file 1). 

After you set the filename, open playback menu, and then click on import. Script will automatically search the folder for matching files. If file exists, it should be on the list. Click on the file.

If everything is ok, you can check status of current playback in selected slot, by checking out text in header of the menu. (eg. ## Slot 1 # OK )

You can also press O (HELP KEY) to display more information about the recording, such as file size, number of points, etc.

Files are usually stored in your \scripts\mbreplay\recordings\ folder. Everything you record can be found there. You can also extract carrec.img to this folder as well.

SINGLE FILE RECORDINGS

If you intend to use only one recording for multiple drivers, always use 1slot. You can load up to 50 bots (theoreticaly even above 100).

MULTIPLE FILES

You can also use up to 50 different recordings simultaniously. Each file must be loaded to separate RRR slot. To change slot, press ADD or SUBTRACT (numpad). 

PLAYBACK

Each AI instance uses a RRR path that we recorded earlier. AI players are independent and can drive on any path, even those recorded by slower vehicles. To make them drive faster or slower, we need to setup AI in our settings file. Note that each recording can have it's own settings (stored in mbreplay folder). 

Whenever you're testing your RRR path with AI, it may be useful to toggle track drawing by pressing F7. Or alternatively, start playback and go to extras menu to enable experimental path drawing.

By default, AI playback is PAUSED, until you Unpause it.

ADJUSTING AI SETTINGS

First thing we need to setup is AI_SPEED_FIX. Higher values (for example 50-100) will make AI drive as fast as it can. Lower values will do the opposite. 

After we setup how fast wiil AI drive, we need to setup how fast will AIs react to curves, opponents and player.  

To set desired throttle at curves, set to for example AI_SPEED_FIX_CURVE=15.0. To force AI to adjust speed a bit earlier, set AI_SPEED_FIX_CURVE_AHEAD=25.

To set throttle for everything else, such as potential crashes, sliding off the track, etc, we need to set AI_SPEED_FIX_HIGH and AI_SPEED_FIX_LOW. If car is going faster AI will use first param, and if slower it's gonna use second param.

To disable dangerous curve routine set AI_DISABLE_DANGEROUS_CURVES=true, and you can also disable crash routine with AI_DISABLE_HIT_CHECK=false. 

We can also set individual settings for AI drivers, by setting AI_MULTIPLIERS. If you set for example BOT_0=50.0 then all speed settings for first AI driver will be lowered by 50%. Adjust to suit required driving style. 


IMPORTANT

Have in mind that AI playback quality depends on above mentioned settings, but also it may be affected by AI_TICK_INTERVAL. Higher the value means less CPU is used for AI computations.

REUSE CARREC IN YOUR SCRIPTS

You can play CARREC files using native functions in any other script you create. First make sure that you add each file you created to carrec.img archive. 
